<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>个人中心</title>
<%@ include file="/WEB-INF/views/layouts/head.jsp" %>
<link href="${ctxStatic }/xiake/css/list.css" rel='stylesheet' type='text/css' />
<link href="${ctxStatic }/index/css/Personal.css" rel="stylesheet">
<script src="${ctxStatic }/jquery/jquery-1.8.3.min.js"></script>
<script src="${ctxStatic }/index/js/Personal.js"></script>
<script type="text/javascript">
	$(function(){
		var keyVal2 = "${sessionScope.mes}";
		if(keyVal2.length!=0){  
			alert(keyVal2);
		}
		//$("#subBtn").attr("disabled", true); 
		$('#inf_safe').trigger('click');
		var tabid  = "${param.id}";
		//既触发了a标签的点击事件，又触发了页面跳转   
		if(tabid.length>0){
			document.getElementById(tabid).click();   
		}
		$("#tab").click(function(){
			$("#searchForm").submit();
		})
		$(".backmoney").click(function(){
			$value = $(this).attr("value");
			$.post("${ctxFront}/sms/checkBackTime","orderid="+$value,function(d){
				if(d==1){//已过发车时间
					alert("已过发车时间,无法退单");
				}else{
					window.location.href = "${ctxFront}/pay/backMoneyPage?orderid="+$value;
				}
			}); 
		})
		$("#fp").click(function(){
			window.location.href = "${ctxFront }/usersRcpt/ordersList";
		})
		$("#search").click(function(){
			$("#searchForm").submit();
		})
		$('#status').change(function(){
			$('#searchForm').submit();
		}); 
		
		$("#subBtn").click(function(){
			//获取输入的值
			var $password1=$("#newPassword").val();
			var $password2=$("#newPassword2").val();
			$.post("${ctxFront}/sms/checkPassword",{"password1":$password1,"password2":$password2},function(d){
				if(d==0){
					$("#confirmTip").html("<font color='red'>两次输入的密码不一致</font>");
					$("#newPassword").click(function(){
						$("#newPassword2").val("");
						$("#confirmNewPassword").val("");
					})
				}else if(d==1){
					$("#confirmTip").html("<font color='red'>6-16位数字和字母的组合</font>");
					$("#newPassword").click(function(){
						$("#newPassword2").val("");
						$("#confirmNewPassword").val("");
					})
				}else if(d==2){
					$("#confirmTip").html("<font color='green'>可以使用</font>");
					//$('#subBtn').removeAttr('disabled');
					$('#modifyPwdForm').submit()
				}
			});
		});
	});
	function page(n,s){
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<%
session.removeAttribute("mes");
	%>
<body >
<div class="member">
    <div class="member_1">
        <h4>会员中心</h4>
    </div>
    <div class="container">

        <ul class="tabs" style="float: left">

            <li><a href="#tab1">个人中心</a></li>
            <li id="tab"><a href="#tab2">我的订单</a></li>
            <li id="fp"><a href="#tab3">关于发票</a></li>
        </ul>

        <div class="table_container">
            <div id="tab1" class="tab_content"style="float: right;" >

                <ul class="tabs_0">
                    <li><a href="#tab4" id="inf_personal"> 信息设置</a></li>&nbsp;&nbsp;&nbsp;
                    <li><a href="#tab5" id="inf_safe">密码重置</a></li>
                </ul>
     <div class="sor"></div>

        <div id="tab4"  class="tabs_content">
                <div class="set">
                <form id="modifyInfoForm" action="${ctxFront }/modifyInfo" method="post">
				<input type="hidden" name="id" value="${user.id }"/>
				<div id="inf_personal_con" class="container_information">
					<c:if test="${sessionScope.front_user.office.parent.id ne '3' }">
						  <dd class="nickname">
    <span class="nickname_0">昵称&nbsp;&nbsp;</span>
    <input type="text" name="name" value="${user.name }"  class="nickname_1"/>
    </dd>
    <dd class="mailbox">
        <span class="mailbox_0">邮箱&nbsp;&nbsp;</span>
        <input type="text" name="email" value="${user.email }" class="nickname_1" id="email"/>
    </dd>
    <dd class="contact">
        <span class="contact_0">联系电话&nbsp;&nbsp;</span>
        <input type="text" name="mobile" value="${user.mobile }" disabled class="nickname_1"/>
    </dd>
					</c:if>
					<c:if test="${sessionScope.front_user.office.parent.id eq '3' }">
					 <dd class="nickname">
    <span class="nickname_0">企业名称&nbsp;&nbsp;</span>
    <input type="text" disabled value="${user.office.name }" class="nickname_1"/>
    </dd>
    <dd class="mailbox">
        <span class="mailbox_0">常用邮箱&nbsp;&nbsp;</span>
        <input type="text" name="email" value="${user.email }" class="nickname_1"/><span class="red">*</span>
    </dd>
    <dd class="contact">
        <span class="contact_0">默认经办人&nbsp;&nbsp;</span>
        <input type="text" name="name" value="${user.name }" class="nickname_1"/>
    </dd>
    <dd class="contact">
        <span class="contact_0">经办人手机&nbsp;&nbsp;</span>
        <input type="text" value="${user.mobile }" disabled class="nickname_1"/>
    </dd>
					</c:if>
					<div>	
					<input type="button" class="keep" name=""value="保存" onclick="$('#modifyInfoForm').submit();">
					<span id="tips1"><font color='red' size='3'>${message}</font></span>
					</div>
				</div>
			</form>
                </div>
          </div>

                <div id="tab5"  class="tabs_content" style="display: none">
                <form id="modifyPwdForm" action="${ctxFront }/modifyPwd" method="post">
                    <div class="set">
                        <dl>
                            <dd class="orginal_password">
                                <span class="nickname_0">原始密码&nbsp;：&nbsp</span>
                                <input class="nickname_1" name="oldPassword" type="password">
                                <span ><font color='red'>*必填</font></span>
                            </dd>
                            <dd class="new_password">
                                <span class="mailbox_0">新密码&nbsp;：&nbsp</span>
                                <input class="mailbox_1" name="newPassword" type="password" id="newPassword" />
                                <span><font color='red'>*必填</font></span>
                            </dd>
                            <dd class="confirm_password">
                                <span class="contact_0">确认密码&nbsp;：&nbsp</span>
                                <input class="contact_1" type="password" name="repeatPassword" id="newPassword2"/>
                                <span id="confirmTip" class="onshow"><font color='red'>*必填</font></span>
                            </dd>
                        </dl>
                        <input type="button" class="keep" value="保存" id="subBtn" >
                        <span id="tips1"><font color='red' size='3'>${message1}</font></span>
                    </div>
                    </form>
                </div>
            </div>
            <div id="tab2" class="tab_content" style="float: right;" >
            <form id="searchForm" action="${ctxFront}/orders/orderList" method="post">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                <div class="order_for">
                    <div class="member_2" >
                        <dl>
                            <dd >
         <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
   <span>订单号：</span>&nbsp;<input type="text" name="orderid" value="${orders.orderid }" placeholder="请输入订单号" class="order">
   <span style="margin-left: 10px;">预定日期：</span>&nbsp;
   <input type="text" id="createDateQueryStart" name="createDateQueryStart" maxlength="20" readonly 
   placeholder="" class="order_1 Wdate" value="${orders.createDateQueryStart }"
   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,maxDate:'#F{$dp.$D(\'createDateQueryEnd\')}'});">
    - <input type="text" id="createDateQueryEnd" name="createDateQueryEnd" maxlength="20" readonly
    placeholder="" class="order_2 Wdate" value="${orders.createDateQueryEnd }"
	onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'#F{$dp.$D(\'createDateQueryStart\')}'});">
    <select name="ordertype">
	<option value="" >全部类型</option>
	<option value="${ORDER_TYPE_RENTPRODUCT_DAY }" ${orders.ordertype == ORDER_TYPE_RENTPRODUCT_DAY?'selected':'' }>按天包车</option>
	<option value="${ORDER_TYPE_RENTPRODUCT_TRAVEL }" ${orders.ordertype == ORDER_TYPE_RENTPRODUCT_TRAVEL?'selected':'' }>旅游包车</option>
	<option value="${ORDER_TYPE_RENTPRODUCT_AIRPLANE }" ${orders.ordertype == ORDER_TYPE_RENTPRODUCT_AIRPLANE?'selected':'' }>接送机</option>
	<option value="${ORDER_TYPE_RENTPRODUCT_CUSTOM }" ${orders.ordertype == ORDER_TYPE_RENTPRODUCT_CUSTOM?'selected':'' }>定制包车</option>
    </select>
      <input class="inquiry"  type="button" value="查询" onclick="$('#searchForm').submit();">

                            </dd>
                        </dl>
                    </div>

                    <div class="my-dig"></div>

<div>

    <div class="table_box">
    
        <table cellpadding="0" cellspacing="0">
            <tr class="order_tbox">
                <th>订单名称</th>
                <th>行程/有效期</th>
                <th>总金额</th>
                <th>
                    <select name="orderstatus" id="status">
                        <option value="">全部</option>
						<option value="${TORDERS_STATUS_NO_PAY }" ${orders.orderstatus == TORDERS_STATUS_NO_PAY?'selected':'' }>未支付</option>
						<option value="${TORDERS_STATUS_PAY }" ${orders.orderstatus == TORDERS_STATUS_PAY?'selected':'' }>已支付</option>
						<option value="${TORDERS_STATUS_BACK }" ${orders.orderstatus == TORDERS_STATUS_BACK?'selected':'' }>已取消</option>
						<option value="${TORDERS_STATUS_CANCEL }" ${orders.orderstatus == TORDERS_STATUS_CANCEL?'selected':'' }>已作废</option>
					</select>
                </th>
                <th>操作</th>
            </tr>
            <c:forEach items="${page.list}" var="orders">
            <tr class="tit_o">
                <td colspan="5">
                    <div class="tito_cc">
                        <span class="date_le">订单号码：${orders.orderid}</span>
                        <span class="time_ri">订单日期：<fmt:formatDate value="${orders.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/></span>
                    </div>
                </td>
            </tr>
            <tr class="order_f">
                <td>
                    ${orders.ordername }
                </td>
                <td>
                    <fmt:formatDate value="${orders.departdate }" pattern="yyyy-MM-dd HH:mm"/>
                </td>
                <td>￥${orders.dueamount}</td>
                <td ><c:if test="${orders.orderstatus == TORDERS_STATUS_PAY}">已支付</c:if>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_NO_PAY}">未支付</c:if>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_BACK}">
						已取消<c:if test="${orders.settlereason == '5'}">（更换车队）</c:if>
					</c:if>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_CANCEL}">已作废</c:if></td>
                <td class="no_paym">
                    <c:if test="${orders.orderstatus == TORDERS_STATUS_NO_PAY}">
                    <c:if test="${orders.ordertype == 'c'}">
                    <a target="_blank" 
                    href="${ctxFront }/rentproduct/demands/list">支付</a>	
                    </c:if>
                    <c:if test="${orders.ordertype != 'c'}">
					<a target="_blank" href="${ctxFront}/pay/payWay?orderid=${orders.orderid}&boardaddrfc=${orders.realscheOff.siteid }&offaddrfc=${orders.realscheBoard.siteid }">支付</a>
                    </c:if>
					<a href="${ctxFront}/pay/cancel?orderid=${orders.orderid}">取消订单</a>
				</c:if>
				<c:if test="${orders.orderstatus == TORDERS_STATUS_PAY}">
					<c:if test="${orders.ordertype == ORDER_TYPE_REALSCHE_SELF_TRAVEL}">
						<a href="${ctxFront}/realsche/backMoney?orderid=${orders.orderid}">退单</a>
					</c:if>
					<c:if test="${orders.ordertype ne ORDER_TYPE_REALSCHE_SELF_TRAVEL}">
						<%-- <a href="${ctxFront}/pay/backMoney?orderid=${orders.orderid}">退单</a> --%>
						<a href="javascript:void(0)" class="backmoney" value="${orders.orderid}">退单</a>
					</c:if>
				</c:if>
				<a href="${ctxFront}/orders/orderDetail?orderid=${orders.orderid}" target="_blank">查看</a>
                </td>
            </tr></c:forEach>
        </table>
        <div style="text-align: center;">
		<div class="pagination  font_normal_size"  style="width: 100%;">${page.html}</div></div>
    </div>
    </form>
</div>

</div></div></div></div>
</body>
</html>
<%@ include file="/WEB-INF/views/layouts/foot.jsp" %>